---
id: "directive-decorator"
keywords: ["directive", "decorator"]
name: "@@directive"
summary: "This is the `@@directive` decorator."
category: "decorators"
---

`@@directive` takes a string literal payload, and will output that string verbatim at the very top of the generated JavaScript file, before any imports.

Useful for outputing directives like [`'use client'`](https://beta.nextjs.org/docs/rendering/server-and-client-components#convention) for React Server Components.

_Available since ReScript `10.1.4`._

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res
@@directive("'use client'")
```

```js
// Generated by ReScript, PLEASE EDIT WITH CARE
"use client";
```

</CodeTab>
